﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using GaugeEngine.Events;
using GaugeEngine.Graphics;

namespace GaugeEngine
{
    public class Level : GameComponent
    {
        private List<Actor> m_actors;

        public Level(Game g) : base(g)
        {
            g.EventController.QueueEvent(new EventData("New_Level"));
            m_actors = new List<Actor>();
        }

        public void AddActor(Actor a)
        {
            m_actors.Add(a);
        }

        public void Draw(Painter p)
        {
            foreach (Actor a in m_actors) a.Draw(p);
        }

        public override void Update(GameTime gameTime)
        {
            foreach (Actor a in m_actors) a.Update(gameTime);
        }
    }
}
